home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
Hyper
/
Q-R
/
RPN Calculator.cpt
/
RPN Calculator
/
card_4669.txt
< prev
next >
Wrap
Text File
|
1988-09-16
|
5KB
|
294 lines
-- card: 4669 from stack: in
-- bmap block id: 5959
-- flags: 4000
-- background id: 4132
-- name: PG
----- HyperTalk script -----
on openCard
global synch
put 1 into synch
put "X" into card field synch
end openCard
-- part 2 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=35 top=145 right=167 bottom=135
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Numbers
----- HyperTalk script -----
on mouseUp
ask "Number steps to:" with last word in field "Step#"
if it < 0 or it > 999 then
exit mouseUp
end if
set the cursor to 4
put 1 into field "Step#"
put 2 into i
repeat until i > it
put Return & i after last line in field "Step#"
put i + 1 into i
end repeat
end mouseUp
-- part 3 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=357 top=95 right=118 bottom=471
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Load Program
----- HyperTalk script -----
on mouseUp
-- ask "Load what program?" with "Program"
-- Comment the next step and un-comment the above if you do not have
-- the "filename" XFCN
put filename() into it
if it is empty then exit mouseUp
put it into fileName
open file fileName
read from file fileName until tab
put empty into last char of it
put it into field "list"
close file fileName
end mouseUp
-- part 4 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=356 top=132 right=154 bottom=472
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Save Program
----- HyperTalk script -----
on mouseUp
put line 1 of field "list" into fileName
ask "Export program to what file?" with fileName
if it is empty then exit mouseUp
put it into fileName
open file fileName
write field "list" to file fileName
write tab to file fileName
close file fileName
end mouseUp
-- part 5 (button)
-- low flags: 00
-- high flags: A003
-- rect: left=358 top=171 right=193 bottom=472
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Print Program
----- HyperTalk script -----
on mouseUp
doMenu "Print Report..."
end mouseUp
-- part 6 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=51 top=276 right=312 bottom=112
-- title width / last selected line: 0
-- icon id / first selected line: 2162 / 2162
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Done
----- HyperTalk script -----
on mouseUp
go to card "Calc"
send mouseUp to card button "Prg"
end mouseUp
-- part 7 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=358 top=212 right=234 bottom=475
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Clear Program
----- HyperTalk script -----
on mouseUp
answer "Clear Program - Are you sure?" with "Yes" or "No"
if it is "Yes" then put empty into field "List"
end mouseUp
-- part 8 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=360 top=258 right=274 bottom=377
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Synch
----- HyperTalk script -----
on mouseUp
global synch
if synch = 1 then
put 0 into synch
put empty into me
else
put 1 into synch
put "X" into me
end if
end mouseUp
-- part contents for background part 2
----- text -----
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
-- part contents for background part 1
----- text -----
Quadratic Roots
#A
x-y
'2
√∑
Rup
Sto
'1
√∑
chs
E
E
*
Rup
Rcl
'1
√∑
-
<->
abs
‚àö
Sto
'1
+
E
'2
Rcl
'1
*
-
R/S
____________
Finds roots of
ax^2 + bx + c
Procedure:
Enter a
Enter b
Enter c
Click [ A ]
Read x1 in y reg
Read x2 in x reg
If value in big register is < 0 then roots are imaginary
-- part contents for card part 8
----- text -----
X